//
//  RBHistoryDateHeader.m
//  zhongzhenglu
//
//  Created by XL on 2022/7/15.
//

#import "RBHistoryDateHeader.h"
#import <Masonry.h>
#import "RBDefine.h"
#import "RBThemeConfig.h"

@interface RBHistoryDateHeader()

@property(nonatomic, strong)UILabel *titleL;

@end

@implementation RBHistoryDateHeader

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        self.backgroundColor = [RBThemeConfig bgGrayColor];
    }
    return self;
}

- (void)setText:(NSString *)text
{
    _text = text;
    self.titleL.text = text;
}

- (UILabel *)titleL
{
    if (!_titleL)
    {
        self.titleL = ({
            UILabel *view = UILabel.new;
            view.font = [UIFont systemFontOfSize:Zoom(16)];
            view.textColor = [RBThemeConfig textBlackColor];
            [self addSubview:view];
            [view mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(Zoom(12));
                make.centerY.mas_equalTo(0);
            }];
            view;
        });
    }
    return _titleL;
}

@end
